package com.bili.bili_data_api.controller;

import com.bili.bili_data_api.dao.pojo.BilibiliWeekly;
import com.bili.bili_data_api.dao.pojo.Guochan;
import com.bili.bili_data_api.service.BilibiliWeeklyService;
import com.bili.bili_data_api.util.Result;
import com.bili.bili_data_api.vo.BilibiliWeeklyVo;
import com.bili.bili_data_api.vo.GuoChanList;
import com.bili.bili_data_api.vo.GuoChanVo;
import com.bili.bili_data_api.vo.QueryVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("BilibiliWeekly")
public class BilibiliWeeklyController {
    @Autowired
    BilibiliWeeklyService bilibiliWeeklyService;

    @PostMapping(value = {"selectByTitle"},produces = {"application/json; charset=UTF-8"})
    public BilibiliWeeklyVo selectByTitle(@RequestBody QueryVo query){
        return bilibiliWeeklyService.selectByTitle(query);
    }

    @PostMapping(value = {"edit"},produces = {"application/json; charset=UTF-8"})
    public Result edit(@RequestBody BilibiliWeekly bilibiliWeekly){
        return bilibiliWeeklyService.edit(bilibiliWeekly);
    }

    @PostMapping(value = {"delete"},produces = {"application/json; charset=UTF-8"})
    public Result delete(@RequestBody BilibiliWeekly bilibiliWeekly){
        return bilibiliWeeklyService.delete(bilibiliWeekly);
    }

    @PostMapping(value = {"add"},produces = {"application/json; charset=UTF-8"})
    public Result add(@RequestBody BilibiliWeekly bilibiliWeekly){
        return bilibiliWeeklyService.add(bilibiliWeekly);
    }
}
